package com.ouyeel.domain;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * Created by lenovo on 2016/9/2.
 */
public class DERequestItemVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;  //主键
    private String requestId;   //询单ID
    private String seq; //序号
    private String materialNo;  //物料代码
    private String materialName;    //物料名称
    private String specification;   //描述
    private String mrNo;   //外部物料代码
    private String requestDeliveryDate;   //要求交货日期
    private String requestAmount;  //采购数量
    private String unit;    //计量单位
    private String materialClassCode; //物料分类代码
    private String materialClassId;   //物料分类ID
    private String character;   //特征
    private String did; //DID
    private String baseTaxed;  //基础税率
    private String packManner; //参考单价
    private String deliveryStatus; //交货状态
    private String others;  //其它
    private String memo;    //备注
    private String currency;    //币种
    private String bidFlag;    //开标标记
    private String dummyLineId;   //PSCS行号
    private String salePrice;  //价格
    private String producer;    //生产厂家
    private String buyPrice;   //已采购单位
    private String purchaseMenuId;    //小类ID
    private String wbs; //WBS编码(For BPMS竞标)
    private String deviceId;   //设备编号(For BPMS竞标)
    private String totalWeight;    //要求重量(For BPMS竞标)
    private String isItemDetail;  //是否为非标物料行
    private String imageUrl;   //图片路径
    private String imageDescription;   //图片描述
    private String imageDescriptionThumbnail; //缩略图路径
    private String planDetailsId; //外部物料ID
    private String flag;    //无报价物料标识
    private String extendItemData;    //表头扩展字段数据A
    private Map<String,Object> extendItemMap;   //自定义字段Map

    private String minPrice;        //最低未税价
    private String minTaxedPrice;   //最低含税价
    private String baseInfo;//TODO 物料综合信息，待确定具体内容完善
    private String moreInfo;//TODO 物料综合信息，待确定具体内容完善
    private String rownum;         //序号
    private List<DEQuotationItemVO> quotationItemList;


    public String getBaseInfo() {
        StringBuffer str = new StringBuffer();
        str.append("物料代码：").append(materialNo).append("  <br/>");
        str.append("物料名称：").append(materialName).append("  <br/>");
        str.append("规格型号：").append(character).append("  <br/>");
        return str.toString();
    }

    public void setBaseInfo(String baseInfo) {
        this.baseInfo = baseInfo;
    }
    public String getMoreInfo() {
        StringBuffer str=new StringBuffer();
//        str.append("物料描述:").append(specification).append("  <br/>");
        str.append("生产厂家(品牌)：").append(producer).append("  <br/>");
        str.append("采购数量：").append(requestAmount).append("  <br/>");
        str.append("计量单位：").append(unit).append("  <br/>");
        str.append("参考单价（元）：").append(salePrice).append("  <br/>");
        //去掉日期后面多余的.0和00:00:00//数据库后中数据含00:00:00,取出来成String后有个.0
        str.append("交货期：").append(requestDeliveryDate.chars().limit(requestDeliveryDate.lastIndexOf('-')+3).mapToObj(ch->Character.valueOf((char) ch).toString()).collect(Collectors.joining())).append("  <br/>");
        str.append("备注：").append(memo).append("  <br/>");
        for ( Map.Entry<String, Object> entry : extendItemMap.entrySet()) {
            str.append(entry.getKey()+":").append(entry.getValue()).append("  <br/>");
        }
        return str.toString();
    }

    public Map<String, Object> getExtendItemMap() {
        return extendItemMap;
    }

    public void setExtendItemMap(Map<String, Object> extendItemMap) {
        this.extendItemMap = extendItemMap;
    }

    public void setMoreInfo(String moreInfo) {
        this.moreInfo = moreInfo;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getSeq() {
        return seq;
    }

    public void setSeq(String seq) {
        this.seq = seq;
    }

    public String getMaterialNo() {
        return materialNo;
    }

    public void setMaterialNo(String materialNo) {
        this.materialNo = materialNo;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public String getSpecification() {
        return specification;
    }

    public void setSpecification(String specification) {
        this.specification = specification;
    }

    public String getMrNo() {
        return mrNo;
    }

    public void setMrNo(String mrNo) {
        this.mrNo = mrNo;
    }

    public String getRequestDeliveryDate() {
        return requestDeliveryDate;
    }

    public void setRequestDeliveryDate(String requestDeliveryDate) {
        this.requestDeliveryDate = requestDeliveryDate;
    }

    public String getRequestAmount() {
        return requestAmount+" "+unit;
    }

    public void setRequestAmount(String requestAmount) {
        this.requestAmount = requestAmount;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getMaterialClassCode() {
        return materialClassCode;
    }

    public void setMaterialClassCode(String materialClassCode) {
        this.materialClassCode = materialClassCode;
    }

    public String getMaterialClassId() {
        return materialClassId;
    }

    public void setMaterialClassId(String materialClassId) {
        this.materialClassId = materialClassId;
    }

    public String getCharacter() {
        return character;
    }

    public void setCharacter(String character) {
        this.character = character;
    }

    public String getDid() {
        return did;
    }

    public void setDid(String did) {
        this.did = did;
    }

    public String getBaseTaxed() {
        return baseTaxed;
    }

    public void setBaseTaxed(String baseTaxed) {
        this.baseTaxed = baseTaxed;
    }

    public String getPackManner() {
        return packManner;
    }

    public void setPackManner(String packManner) {
        this.packManner = packManner;
    }

    public String getDeliveryStatus() {
        return deliveryStatus;
    }

    public void setDeliveryStatus(String deliveryStatus) {
        this.deliveryStatus = deliveryStatus;
    }

    public String getOthers() {
        return others;
    }

    public void setOthers(String others) {
        this.others = others;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getBidFlag() {
        return bidFlag;
    }

    public void setBidFlag(String bidFlag) {
        this.bidFlag = bidFlag;
    }

    public String getDummyLineId() {
        return dummyLineId;
    }

    public void setDummyLineId(String dummyLineId) {
        this.dummyLineId = dummyLineId;
    }

    public String getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(String salePrice) {
        this.salePrice = salePrice;
    }

    public String getProducer() {
        return producer;
    }

    public void setProducer(String producer) {
        this.producer = producer;
    }

    public String getBuyPrice() {
        return buyPrice;
    }

    public void setBuyPrice(String buyPrice) {
        this.buyPrice = buyPrice;
    }

    public String getPurchaseMenuId() {
        return purchaseMenuId;
    }

    public void setPurchaseMenuId(String purchaseMenuId) {
        this.purchaseMenuId = purchaseMenuId;
    }

    public String getWbs() {
        return wbs;
    }

    public void setWbs(String wbs) {
        this.wbs = wbs;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getTotalWeight() {
        return totalWeight;
    }

    public void setTotalWeight(String totalWeight) {
        this.totalWeight = totalWeight;
    }

    public String getIsItemDetail() {
        return isItemDetail;
    }

    public void setIsItemDetail(String isItemDetail) {
        this.isItemDetail = isItemDetail;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getImageDescription() {
        return imageDescription;
    }

    public void setImageDescription(String imageDescription) {
        this.imageDescription = imageDescription;
    }

    public String getImageDescriptionThumbnail() {
        return imageDescriptionThumbnail;
    }

    public void setImageDescriptionThumbnail(String imageDescriptionThumbnail) {
        this.imageDescriptionThumbnail = imageDescriptionThumbnail;
    }

    public String getPlanDetailsId() {
        return planDetailsId;
    }

    public void setPlanDetailsId(String planDetailsId) {
        this.planDetailsId = planDetailsId;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getExtendItemData() {
        return extendItemData;
    }

    public void setExtendItemData(String extendItemData) {
        this.extendItemData = extendItemData;
    }

    public List<DEQuotationItemVO> getQuotationItemList() {
        return quotationItemList;
    }

    public void setQuotationItemList(List<DEQuotationItemVO> quotationItemList) {
        this.quotationItemList = quotationItemList;
    }

    public String getMinPrice() {
        return minPrice;
    }

    public void setMinPrice(String minPrice) {
        this.minPrice = minPrice;
    }

    public String getMinTaxedPrice() {
        return minTaxedPrice;
    }

    public void setMinTaxedPrice(String minTaxedPrice) {
        this.minTaxedPrice = minTaxedPrice;
    }

    public String getRownum() { return rownum; }

    public void setRownum(String rownum) { this.rownum = rownum; }
}
